export function fixTreeData(treeData, idKey, parentIdKey) {
    idKey = idKey || "id";
    parentIdKey = parentIdKey || "pid";
    // 找到所有断层节点
    const brokenNodes = treeData.filter((node) => node.code && !treeData.find((parent) => parent.code === node.pCode));
    // 将这些节点的pid属性置为空，使其成为顶级节点
    brokenNodes.forEach((node) => {
        node.pCode = "0";
    });
    // 返回修复后的树数据
    return treeData;
}
